/*
 * GUI.cpp
 *
 *  Created on: Aug 21, 2010
 *      Author: Ry
 */
#include <algorithm>
#include "GUI.h"

using namespace std;

GUI::GUI() {
}

Component *GUI::add(Component *component) {
	this->components.push_back(component);
	return component;
}

void GUI::destroy(Component *component) {
	std::vector<Component*>::iterator i = components.erase(std::remove(components.begin(), components.end(), component), components.end());
	delete component;
}

GUI::~GUI() {
	for (unsigned int i = 0; i < components.size(); i++) {
		delete components[i];
	}
}
